import{d as t,M as l,A as r,h as s}from"./Anchors-CRD96j4l.js";import{D as c,a as i}from"./Demo-Ck8WGKWN.js";import"./index-BpvWz174.js";const o={path:"/view/message",name:"message",title:"Message 消息提示"};function d(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",span:"span",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...n.components};return l(s,{children:[l("div",{class:"sys-ctx-main-left",children:[l(e.h1,{id:"sp-",children:[t(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#sp-",children:t(e.span,{className:"icon icon-link"})}),o.title]}),l(e.h2,{id:"sp-demos",children:[t(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#sp-demos",children:t(e.span,{className:"icon icon-link"})}),"代码演示 "]}),t(c,{columns:2}),t(i,{id:"base",title:"基本用法",src:"1base.demo.tsx",code:`import { Button, message, Space } from "cui-solid";

export default () => {
    return <Space dir="h">
        <Button type="primary" onClick={() => {
            message.info('提示信息')
        }}>消息</Button>
        <Button type="primary" onClick={() => {
            message.success('登录成功')
        }}>成功</Button>
        <Button type="primary" onClick={() => {
            message.error('添加错误')
        }}>错误</Button>
        <Button type="primary" onClick={() => {
            message.warning('需要数字类型')
        }}>警告</Button>
    </Space>
}`,scopes:void 0,children:t(e.p,{children:"基础用法"})}),t(i,{id:"background",title:"背景色",src:"2background.demo.tsx",code:`import { Button, message, Space } from "cui-solid";

export default () => {
    return <Space dir="h">
        <Button type="primary" onClick={() => {
            message.info({
                content: '提示信息',
                background: true
            })
        }}>消息</Button>
        <Button type="primary" onClick={() => {
            message.success({
                content: '登录成功',
                background: true
            })
        }}>成功</Button>
        <Button type="primary" onClick={() => {
            message.error({
                content: '添加错误',
                background: true,
            })
        }}>错误</Button>
        <Button type="primary" onClick={() => {
            message.warning({
                content: '需要数字类型',
                background: true,
            })
        }}>警告</Button>
    </Space>
}`,scopes:void 0,children:l(e.p,{children:["配置参数 ",t(e.code,{className:"sp-inline-code",children:"background"})," 可以显示背景色"]})}),t(i,{id:"close",title:"可关闭",src:"3close.demo.tsx",code:`import { Button, message, Space } from "cui-solid";

export default () => {
    return <Space dir="h">
        <Button type="primary" onClick={() => {
            message.info({
                content: '可关闭message',
                background: true,
                closeable: true,
                duration: 0
            })
        }}>可关闭</Button>
    </Space>
}`,scopes:void 0,children:l(e.p,{children:["配置参数 ",t(e.code,{className:"sp-inline-code",children:"closeable"})," 可关闭消息"]})}),t(i,{id:"loading",title:"加载中",src:"4loading.demo.tsx",code:`import { Button, message, Space } from "cui-solid";
import { createUniqueId } from "solid-js";

export default () => {
    return <Space dir="h">
        <Button type="primary" onClick={() => {
            const key = createUniqueId();
            message.info({
                key,
                content: 'Loading...',
                background: true,
                loading: true,
                duration: 0
            })

            setTimeout(() => {
                message.close(key);
            }, 4000)
        }}>加载</Button>
    </Space>
}`,scopes:void 0,children:l(e.p,{children:["配置参数 ",t(e.code,{className:"sp-inline-code",children:"loading"})," 显示加载中的消息， message可通过 ",t(e.code,{className:"sp-inline-code",children:"key"})," 关闭消息"]})}),l(e.h2,{id:"props",children:[t(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#props",children:t(e.span,{className:"icon icon-link"})}),"属性 "]}),l(e.table,{className:"sp-table",children:[t(e.thead,{children:l(e.tr,{children:[t(e.th,{style:{textAlign:"left"},children:"属性"}),t(e.th,{style:{textAlign:"left"},children:"说明"}),t(e.th,{style:{textAlign:"left"},children:"类型"}),t(e.th,{style:{textAlign:"left"},children:"默认值"})]})}),l(e.tbody,{children:[l(e.tr,{children:[t(e.td,{style:{textAlign:"left"},children:"classList"}),t(e.td,{style:{textAlign:"left"},children:"自定义class"}),t(e.td,{style:{textAlign:"left"},children:"Object"}),t(e.td,{style:{textAlign:"left"},children:"-"})]}),l(e.tr,{children:[t(e.td,{style:{textAlign:"left"},children:"class"}),t(e.td,{style:{textAlign:"left"},children:"自定义class"}),t(e.td,{style:{textAlign:"left"},children:"string"}),t(e.td,{style:{textAlign:"left"},children:"-"})]}),l(e.tr,{children:[t(e.td,{style:{textAlign:"left"},children:"style"}),t(e.td,{style:{textAlign:"left"},children:"自定义样式"}),t(e.td,{style:{textAlign:"left"},children:"Object"}),t(e.td,{style:{textAlign:"left"}})]}),l(e.tr,{children:[t(e.td,{style:{textAlign:"left"},children:"key"}),t(e.td,{style:{textAlign:"left"},children:"消息的标识，调用close可根据key进行关闭"}),t(e.td,{style:{textAlign:"left"},children:"string"}),t(e.td,{style:{textAlign:"left"}})]}),l(e.tr,{children:[t(e.td,{style:{textAlign:"left"},children:"duration"}),t(e.td,{style:{textAlign:"left"},children:"显示时间，为0时不销毁"}),t(e.td,{style:{textAlign:"left"},children:"number"}),t(e.td,{style:{textAlign:"left"},children:"4"})]}),l(e.tr,{children:[t(e.td,{style:{textAlign:"left"},children:"type"}),t(e.td,{style:{textAlign:"left"},children:"类型"}),t(e.td,{style:{textAlign:"left"},children:"info | success | warning | error"}),t(e.td,{style:{textAlign:"left"},children:"info"})]}),l(e.tr,{children:[t(e.td,{style:{textAlign:"left"},children:"class"}),t(e.td,{style:{textAlign:"left"},children:"class类"}),t(e.td,{style:{textAlign:"left"},children:"string"}),t(e.td,{style:{textAlign:"left"}})]}),l(e.tr,{children:[t(e.td,{style:{textAlign:"left"},children:"content"}),t(e.td,{style:{textAlign:"left"},children:"内容"}),t(e.td,{style:{textAlign:"left"},children:"JSXElement"}),t(e.td,{style:{textAlign:"left"}})]}),l(e.tr,{children:[t(e.td,{style:{textAlign:"left"},children:"closeable"}),t(e.td,{style:{textAlign:"left"},children:"可显示关闭按钮"}),t(e.td,{style:{textAlign:"left"},children:"boolean"}),t(e.td,{style:{textAlign:"left"}})]}),l(e.tr,{children:[t(e.td,{style:{textAlign:"left"},children:"background"}),t(e.td,{style:{textAlign:"left"},children:"显示背景色"}),t(e.td,{style:{textAlign:"left"},children:"any"}),t(e.td,{style:{textAlign:"left"}})]}),l(e.tr,{children:[t(e.td,{style:{textAlign:"left"},children:"loading"}),t(e.td,{style:{textAlign:"left"},children:"加载中"}),t(e.td,{style:{textAlign:"left"},children:"boolean"}),t(e.td,{style:{textAlign:"left"}})]}),l(e.tr,{children:[t(e.td,{style:{textAlign:"left"},children:"onClose"}),t(e.td,{style:{textAlign:"left"},children:"关闭回调函数"}),t(e.td,{style:{textAlign:"left"},children:"Function"}),t(e.td,{style:{textAlign:"left"}})]})]})]}),l(e.h2,{id:"events",children:[t(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#events",children:t(e.span,{className:"icon icon-link"})}),"事件 "]}),l(e.table,{className:"sp-table",children:[t(e.thead,{children:l(e.tr,{children:[t(e.th,{style:{textAlign:"left"},children:"事件名称"}),t(e.th,{style:{textAlign:"left"},children:"说明"}),t(e.th,{style:{textAlign:"left"},children:"返回值"})]})}),t(e.tbody,{children:l(e.tr,{children:[t(e.td,{style:{textAlign:"left"},children:t(e.code,{className:"sp-inline-code",children:"onClose"})}),t(e.td,{style:{textAlign:"left"},children:"关闭回调函数"}),t(e.td,{style:{textAlign:"left"}})]})})]})]}),`
`,`
`,`
`,t(r,{data:[{id:"",depth:1,title:""},{id:"sp-demos",depth:2,title:"代码演示"},{id:"base",title:"基本用法",src:"1base.demo.tsx"},{id:"background",title:"背景色",src:"2background.demo.tsx"},{id:"close",title:"可关闭",src:"3close.demo.tsx"},{id:"loading",title:"加载中",src:"4loading.demo.tsx"},{id:"props",depth:2,title:"属性"},{id:"events",depth:2,title:"事件"}]})]})}function y(n={}){const{wrapper:e}=n.components||{};return e?t(e,{...n,children:t(d,{...n})}):d(n)}export{y as default,o as frontmatter};
